const http = require('http')
const connect = require('connect')
const cors = require('cors')
const apiMocker = require('connect-api-mocker')

function mock() {
  const app = connect()
  app.use(cors())
  app.use(apiMocker('/api', './mock/api'))
  http.createServer(app).listen(8082)
}

module.exports = mock
